﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpGUiBaseInterface.h"
#include "UiEditModeUtils.h"

namespace gcmp
{
    class IDocument;
    class IUiDocument;
}

namespace gcmp
{
    /// \brief 编辑模式Ui行为扩展接口
    ///
    /// 自定义的UiEditModeBehavior可通过 REGISTER_UI_EDIT_MODE_BEHAVIOUR 进行注册
    /// 
    /// \see UiEditModeUtils.h
    class GCMP_GUI_BASE_INTERFACE_EXPORT IUiEditModeBehavior
    {
    public:
        /// \brief 更新编辑模式下的Ui控件
        /// \param pDocument 当前文档指针
        /// \param pContextualPage Ribbon上下文面板
        /// \return true-设置成功；false-设置失败
        //virtual bool UpdateRibbonContextualPage(gcmp::IDocument* pDocument, IRibbonContextualPage *pContextualPage) = 0;

        /// \brief 编辑模式进入时会调用
        /// \param pDocument 当前文档指针
        /// \return true-设置成功；false-设置失败
        virtual void OnEnterEditMode(IDocument* pDocument) = 0;

        /// \brief 编辑模式退出前会调用
        /// \return void
        virtual void OnBeforeExitEditMode() = 0;

        /// \brief 判断命令在编辑器模式内是否允许使用
        /// \param commandId 命令Id
        /// \return true-命令在编辑模式内可用；false-命令在编辑模式内不可用
        virtual bool IsCommandEnabled(const std::wstring& commandId) const = 0;

    public:
        /// \brief 析构函数
        virtual ~IUiEditModeBehavior();
    };
}

